package com.example.demo.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import com.example.demo.dto.SearchInfo;
import com.example.demo.entity.Department;



@Repository()
public interface Department_Mapper extends BaseMapper<Department>{
	
	@Select("select * from Department ${where} ${limitstr}")
	public List<Department> select(SearchInfo info);
	@Select("select count(1) from Department ${where} ")
	public long selectCount(SearchInfo info);
	
	@Insert("insert into Department (name) values(#{name})")
	public void insert (Department u);
	
	@Update("update Department set name=#{name} where id=#{id}")
	public void update (Department u);
	
	
	@Select("delete from Department where id=#{id}")
	public void delete(int id);
	
	@Select("select * from Department where id=#{id} ")
	public Department selectById(int id);
	
}
